
public class Test {
    public static void say(Animal animal) {
        animal.say();
    }
    public static void main(String[] args) {
        Dog dog = new Dog();
        Cat cat = new Cat();
        Test.say(dog);
        Test.say(cat);
    }
}
class Animal {
    public void say() {
    }
}
class Dog extends Animal {
    @Override
    public void say() {
        System.out.println("汪汪汪");
    }
}
class Cat extends Animal {
    public void say() {
        System.out.println("喵喵喵");
    }
}